﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSL_Tools.XMLTools;
using System.Xml;
using System;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace ReportingAppConfig
{
    [Serializable]
    public class CoreTable
    {
        #region -- Public Properties ----------------------------------------------------
        //<table type="PerfmonIntervalTable" name="Processor Utilization" category="Processor" 
        //Counter="% Processor Time" Instance="_Total" Machine="__SUTList" enabled="true" />
        coreTablePropertySet propertySet { get; set; }
        public string name { get; set; }
        public string category { get; set; }
        public string counter { get; set; }
        public string instance { get; set; }
        public string machine { get; set; }
        public string type { get; set; }
        #endregion

        #region -- Private Properties ---------------------------------------------------
        ThicknessConverter tc = new ThicknessConverter();
        #endregion

        #region -- Constructors ---------------------------------------------------------
        public CoreTable() { }
        #endregion

        #region -- Public Methods -------------------------------------------------------
        /// <summary>
        /// Used to load the config user settings into the  <see cref="AppConfiguration"/> class settings
        /// </summary>
        public void GetConfigValues(XmlDocument xDoc)
        {
        }

        /// <summary>
        /// Used to set the <see cref="AppConfiguration"/> class settings back into the config user settings file and then to save them.
        /// </summary>
        public void SaveConfigValues(XmlDocument xDoc)
        {
        }

        #endregion

        #region -- Private Methods ------------------------------------------------------
        #endregion
    }

    public class coreTablePropertySet
    {
        #region -- Public Properties ----------------------------------------------------
        public double cellSpacing = 0;
        SolidColorBrush tableBackgroundBrush = Brushes.White;
        SolidColorBrush tableBorderBrush = Brushes.Black;

        SolidColorBrush titleRowBackgroundBrush = Brushes.Wheat;
        SolidColorBrush titleRowBorderBrush = Brushes.Black;
        double titleRowFontSize = 14.4;

        FontWeight headerRowFontWeight = System.Windows.FontWeights.Bold;
        double headerRowFontSize = 14;
        SolidColorBrush headerRowCellBorderBrush = Brushes.Black;
        SolidColorBrush headerRowCellBackgroundBrush = Brushes.Gainsboro;
        //Thickness headerRowCellBorderThickness = (Thickness)_tc.ConvertFromString("1pt");
        Thickness headerRowCellBorderThickness = new Thickness(1);
        Thickness headerRowCellPadding = new Thickness(2);
        #endregion

        #region -- Private Properties ---------------------------------------------------
        ThicknessConverter tc = new ThicknessConverter();
        #endregion

        #region -- Constructors ---------------------------------------------------------
        public coreTablePropertySet() { }
        #endregion

        #region -- Private Methods ------------------------------------------------------
        private Thickness GetThicknessFromString(string thickness)
        {
            return (Thickness)tc.ConvertFromString(thickness);
        }
        #endregion
    }
}
